<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>模块和权限</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.6.8/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main" id="id_div_main">
        ...
    </div>
</div>
<script src="/lib/layui-v2.6.8/layui.js" charset="utf-8"></script>
<script src="/js/lay-config.js?v=2.0.0" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'layer'], function () {
        var $ = layui.jquery,
            layer = layui.layer;

        $.get('/admin/user/getCurrent', {}, function (re) {
            if (re.code == 0) {
                layui.use('watermark', function (watermark) {
                    watermark({watermark_txt: re.data.name});
                });
            }
        }, 'json');

        let load = layer.load(2);
        $.get('/admin/user/getCurrent', {'more': 1}, function (re) {
            layer.close(load);
            if (re.code != 0) {
                layer.alert('用户信息加载失败！' + re.msg);
                return false;
            }
            let data = re.data;
            let html = '您好<span class="layui-badge layui-bg-gray">' + data.name + '</span> ! 您是 <span class="layui-badge layui-bg-gray">' + data.admin_role.name + '</span> .<br /><br />';
            html += '您上次登录的 IP 地址是 <span class="layui-badge layui-bg-gray">' + data.last_ip + '</span> ,<br />上次登录的时间是 <span class="layui-badge layui-bg-gray">' + data.last_login + '</span> .';
            $('#id_div_main').html('<blockquote class="layui-elem-quote layui-quote-nm">' + html + '</blockquote>');
        }, 'json');
    });
</script>

</body>
</html>